projects
/
project
/
bcm63xx
/
u-boot.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
a571092
)
mmc: free allocated memory on initialization errors
author
Darwin Rambo
<
[email protected]
>
Mon, 26 May 2014 20:31:12 +0000
(13:31 -0700)
committer
Pantelis Antoniou
<
[email protected]
>
Thu, 12 Jun 2014 12:21:12 +0000
(15:21 +0300)
Cleanup to balance malloc/free calls.
Signed-off-by: Darwin Rambo <
[email protected]
>
Reviewed-by: Steve Rae <
[email protected]
>
Acked-by: Pantelis Antoniou <
[email protected]
>
drivers/mmc/kona_sdhci.c
patch
|
blob
|
history
diff --git
a/drivers/mmc/kona_sdhci.c
b/drivers/mmc/kona_sdhci.c
index 77e42c8afe87c1d4cce3abe9fe377df497491c3d..f804f4c0dbfc1f9af79b9289bc88790ef8143cac 100644
(file)
--- a/
drivers/mmc/kona_sdhci.c
+++ b/
drivers/mmc/kona_sdhci.c
@@
-113,16
+113,20
@@
int kona_sdhci_init(int dev_index, u32 min_clk, u32 quirks)
__func__, dev_index);
ret = -EINVAL;
}
- if (ret)
+ if (ret) {
+ free(host);
return ret;
+ }
host->name = "kona-sdhci";
host->ioaddr = reg_base;
host->quirks = quirks;
host->host_caps = MMC_MODE_HC;
- if (init_kona_mmc_core(host))
+ if (init_kona_mmc_core(host)) {
+ free(host);
return -EINVAL;
+ }
if (quirks & SDHCI_QUIRK_REG32_RW)
host->version = sdhci_readl(host, SDHCI_HOST_VERSION - 2) >> 16;